using System;
using System.Web.Configuration;

namespace PhotoGallery.Configuration
{
    public class ConfigurationManager
    {
        private static ChapterConfigurationSectionGroup group;

        static ConfigurationManager()
        {
            System.Configuration.Configuration config;
            try
            {
                config = WebConfigurationManager.OpenWebConfiguration("/");
            }
            catch
            {
                config = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None);
            }

            group = config.GetSectionGroup("PhotoGallery.configuration") as ChapterConfigurationSectionGroup;
        }

        public static ProvidersParagraphConfigurationSection Providers
        {
            get
            {
                return group.Providers;
            }
        }
    }
}